<div class="row-fluid">
    <div class="box span12">
        <div class="box-header" data-original-title>
            <h2>
                <i class="icon-list"></i><span class="break"></span>
                Category
            </h2>
            <div class="box-icon">
                <a href="#" class="btn-minimize"><i class="icon-chevron-up"></i></a>
            </div>
        </div>
        <div class="box-content">
            <p class="text-left">
                <a class="btn btn-success" href="
                <?php
                echo Yii::app()->createUrl("category/create", array(
                ));
                ?>">
                    <i class="icon-plus-sign"></i> Create Category
                </a>            
            </p>
            <div class="table-responsive">
                <table class="table table-bordered table-striped table-condensed">
                    <thead>
                        <tr>
                            <th>Avatar</th>
                            <th>Name</th>
                            <th class="text-right">Show Type</th>
                            <th class="text-right">Merchant Category</th>
                            <th class="text-center">Action</th>                                          
                        </tr>
                    </thead>   
                    <tbody>
                        <?php if ($model): ?>
                            <?php foreach ($model as $item): ?>
                                <tr data="<?php $item->category_id ?>">
                                    <td class="text-center">
                                        <img width="60" height="60" src="<?php echo $item->publicAvatar ?>" />
                                    </td>
                                    <td>
                                        <?php echo $item->name ?>
                                    </td>
                                    <td class="center text-center">
                                        <?php echo $item->showType ?>
                                        <?php // if ($item->isshow == 1): ?>
                                            <!--<i class="icon-ok"></i>-->
                                        <?php // endif; ?>
                                    </td>
                                    <td class="center text-right">
                                        <?php echo isset($item->group->name) ? $item->group->name : '' ?>
                                    </td>
                                    <td class="center">
                                        <a href="<?php
                                        echo Yii::app()->createUrl('category/edit', array(
                                            'pk' => $item->category_id,
                                        ));
                                        ?>" class="btn btn-info">
                                            <i class="icon-edit "></i>                                            
                                        </a>
                                        <a class="btn btn-danger" 
                                           href="<?php
                                           echo Yii::app()->createUrl('category/delete', array(
                                               'pk' => $item->category_id,
                                           ));
                                           ?>">
                                            <i class="icon-trash "></i> 
                                        </a>
                                    </td>                                       
                                </tr>
                            <?php endforeach; ?>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
            <div class="pagination pagination-centered">
                <?php
                $this->widget('application.widgets.MyLinkPager', array(
                    'pages'                => $pages,
                    'header'               => '',
                    'maxButtonCount'       => 5,
                    'nextPageLabel'        => '&raquo;',
                    'firstPageLabel'       => '←',
                    'lastPageLabel'        => '→',
                    'prevPageLabel'        => '&laquo;',
                    'selectedPageCssClass' => 'active',
                    'htmlOptions'          => array(
                        'class' => ''
                    )
                ))
                ?>
            </div>
        </div>
    </div>
</div>